using namespace std;
#include <iostream>

int main()
{
  int prev=1,prevprev=0,current=2,temp=0, sum=0;
  while(current<=4000000)
    {
      if((current%2) == 0)
	sum +=current;

      temp = current+prev;
      prevprev=prev;
      prev=current;
      current = temp;
    }
  cout << "Sum is : " << sum << endl;
  return 0;
}
